package com.gxa.order.feign;

import com.gxa.common.commons.JsonResult;
import com.gxa.common.commons.R;


import com.gxa.common.pojo.HotelOrder;
import com.gxa.common.commons.JsonResult;
import com.gxa.common.commons.R;
import com.gxa.common.pojo.HotelOrderTenant;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.util.Map;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.HashMap;


@FeignClient(value = "nacos-consumer-order")
public interface ServiceOrderApi {
    /**
     * 查询订单（含条件搜索接口）
     * @param map
     * @return
     */
    @PostMapping("/hotel_order/findorder")
    public JsonResult findHotelOrderList(@RequestBody Map map);

    /**
     * 住宿订单类型数量
     * @param statu
     * @return
     */
    @PostMapping("/hotel_order/count")
    public JsonResult count(@RequestParam("statu") Integer statu);

    /**
     * 查看住宿订单详情
     * @param id
     * @return
     */
    @PostMapping("/hotel_order/findorder_id")
    public JsonResult findHotelOrder(@RequestParam("id") Integer id);
    /**
     * 删除住宿订单
     * @param id
     * @return
     */
    @PostMapping("/hotel_order/Delorder_id")
    public R delHotelOrder(@RequestParam("id") Integer id);
    /**
     * 修改支付状态（支付时间和支付方式）
     * @param payTime
     * @param payType
     * @param statu
     * @param id
     * @return
     */
    @PostMapping("/updataorder")
    public R updateHotelOrder(@RequestParam("payTime") String payTime,@RequestParam("payType") Integer payType,@RequestParam("statu") Integer statu,@RequestParam("id") Integer id);

    /**
     * 增加住宿订单
     * @param hotelOrderTenant
     * @return
     */
    @PostMapping("/addorder")
    public R addHotelOrder(HotelOrderTenant hotelOrderTenant);
    /**
     * 修改住宿订单状态
     * @param statu
     * @param id
     * @return
     */
    @GetMapping("/hotel_order/updatestatu")
    public R updatestatu(@RequestParam("statu") Integer statu,@RequestParam("id") Integer id);
    /**
     * 修改订单房间号
     * @param id
     * @param roomId
     * @return
     */
    @GetMapping("/hotel_order/updateroom")
    public R updateRoom(@RequestParam("id") Integer id,@RequestParam("roomId") Integer roomId,@RequestParam("room_number")String room_number);
    /**
     * 根据订单编号查看订单id
     * @param orderNumber
     * @return
     */
    @PostMapping("/findOrderId")
    public R findid(@RequestParam("orderNumber") String orderNumber);

    //根据条件查询所有的酒店民宿
    @PostMapping("/Hotel/findAllHotelByCondition")
    public JsonResult findAllHotelByCondition(@RequestBody HashMap map);
    /**
     * 根据订单id查看状态
     * @param id
     * @return
     */
    @PostMapping("/findOrderStatu")
    public R findOrderStatu(@RequestParam("id") Integer id);

    //根据id查找酒店和民宿
    @GetMapping("/findHotelById")
    public R findHotelById(Integer hotel_id);

    /**
     * 9:用户下服务订单查询（点击查看详情）
     * @return
     */
    @GetMapping("/findCleanOrder5")
    public JsonResult findCleanOrder5(Integer cleanOrderId);

    /**
     * 11:取消订单
     * @return
     */
    @PostMapping("/delCleanOrder")
    public R delCleanOrder(Integer cleanOrderId);

    /**
     * 30：根据订单编号查订单id
     * @param cleanOrderNumber
     * @return
     */
    @GetMapping("/findOrderIdByNumber")
    public JsonResult findOrderIdByNumber(String cleanOrderNumber);


    /**
     * 31：根据订单id编辑支付时间
     * @param cleanOrderId
     * @param payTime
     * @return
     */

    @GetMapping("/updateOrderPayTime")
    public JsonResult updateOrderPayTime(@RequestParam("cleanOrderId")Integer cleanOrderId,@RequestParam("payTime")String payTime);


}
